Skip to content

feat(cli): add experimental stack status - #6508

Merged
Coly010 merged 23 commits into
developfrom
feat/experimental-stack-status
Sep 14, 2026
Merged

feat(cli): add experimental stack status#6508
Coly010 merged 23 commits into
developfrom
feat/experimental-stack-status

Conversation

@jgoux

@jgoux jgoux commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Adds status inspection and connection-variable export for the experimental local stack backend. With [experimental] stack = true or SUPABASE_EXPERIMENTAL_STACK=1, supabase status and supabase stack status use the same implementation. With the feature disabled, the stack command group is absent and top-level status keeps its legacy behavior.

Status reports identity, runtime, owner, readiness, endpoints, and configuration drift without revealing credential values. Configuration is loaded from the selected stack’s project, including when inspecting an ID from another working directory. Invalid or unreadable configuration leaves inspection available and marks drift unavailable; an absent config uses defaults.

--env exports running-stack connection variables as dotenv or a JSON variable map. --override-name supports repeated or comma-separated renames and rejects invalid names or collisions. Database-only stacks export database credentials without API credentials. Stopped stacks and credential failures return an error without partial output. Legacy -o/--output values are rejected with guidance to use --output-format or --env.

Supersedes #6517.

@jgoux
jgoux requested a review from a team as a code owner September 7, 2026 23:36
@jgoux
jgoux force-pushed the feat/experimental-stack-status branch from e120ca7 to 1764f96 Compare September 8, 2026 05:31
@jgoux
jgoux force-pushed the feat/experimental-stack-status branch 2 times, most recently from fa05922 to 34ca600 Compare September 8, 2026 12:32
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@34ca600fdad2a3cbe8f166998f05d4b6fdbc4d6f

Preview package for commit 34ca600.

@jgoux

jgoux commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review

Base automatically changed from feat/experimental-stack-stop to develop September 9, 2026 11:37
@avallete
avallete force-pushed the feat/experimental-stack-status branch from 34ca600 to 9ad64f6 Compare September 11, 2026 11:14
@jgoux

jgoux commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

On this one, can we integrate :

status --env exports connection variables as dotenv or a JSON variable map, with --override-name for application-specific names. Ordinary status does not reveal credentials. Database-only stacks can retrieve database credentials with API credentials omitted when Auth is disabled.

It was done here but I'm closing this PR as well and porting what was done for start/stop/destroy directly from develop.

Database-only stacks previously failed credentials() with an
InvalidStackConfigError. The api credentials are now optional and are
omitted when the Auth capability is disabled.
Suppress the JSON serialization lint in the redaction assertions of the
drift test and add ExperimentalStackStatusError to the error-tag
fixture.
status --env exports connection variables as dotenv or a JSON variable
map, with --override-name for application-specific names. Ordinary
status does not reveal credentials. Database-only stacks export database
credentials with API credentials omitted when Auth is disabled.

An absent config.toml is compared against default settings, matching
stack start; invalid configuration still reports drift as unavailable.
The legacy -o env form is rejected with a pointer to --env.
supabase status follows [experimental] stack and
SUPABASE_EXPERIMENTAL_STACK like start and stop, so a project on the new
backend gets a status command that understands its stack.
output.success merges message into the JSON payload, so --env produced
{ DB_URL, message: "" }. Use output.result for the bare variable map and
assert the serialized shape in the integration test.
@Coly010

Coly010 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

/ai-review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Verified all 11 reported findings against the PR code and trusted repository conventions. One duplicate was merged, yielding 10 findings: five minor and five nit-level. All are confirmed; no critical or major issues were found.

Findings

Severity Location Category Sources Claim
🟡 MINOR apps/cli/src/commands/experimental/stack/status/status.errors.ts:16 telemetry claude The runtime reason is incorrectly classified as an external-service network failure even when it represents user-actionable lifecycle or local encoding errors.
🟡 MINOR apps/cli/src/commands/experimental/stack/status/status.handler.ts:229 error-handling claude Configuration comparison errors discard their precise typed diagnostic and inaccurately report that the project configuration could not be loaded.
🟡 MINOR apps/cli/docs/stack-commands.md:31 documentation claude The migration guide mentions rejection of legacy -o env but omits that every explicit legacy -o/--output value, including json and pretty, is rejected by the stack backend.
🟡 MINOR apps/cli/src/commands/experimental/stack/status/status.env.ts:84 correctness codex Text export rejects values containing both a single quote and a backtick even when they can be represented losslessly with dotenv double quotes.
🟡 MINOR apps/cli/src/commands/experimental/stack/status/status.env.ts:39 correctness codex Override collision validation includes optional variables that will not be exported, rejecting non-colliding renames on capability-limited stacks.
⚪ NIT packages/config/src/experimental.ts:44 documentation claude The generated public configuration schemas retain the old description that says the stack backend affects only start and stop.
⚪ NIT apps/cli/src/commands/experimental/stack/status/status.env.ts:37 validation claude Conflicting repeated overrides for the same source variable are silently resolved last-wins.
⚪ NIT apps/cli/src/commands/experimental/stack/status/status.handler.ts:213 code-quality claude The environment-export branch returns an unrelated optional inspection whose presence depends solely on whether --stack-id was used.
⚪ NIT apps/cli/src/commands/experimental/stack/status/status.handler.ts:226 performance claude Status with --stack-id and a loadable configuration inspects the stack twice, repeating the owner status RPC.
⚪ NIT apps/cli/src/commands/experimental/stack/status/SIDE_EFFECTS.md:49 documentation claude+codex The side-effect contract omits the command's exit-code behavior and telemetry-state write.

Stats

Claude findings: 8 · Codex findings: 3 · Confirmed: 10 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5 + gpt-5.6-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/src/commands/experimental/stack/status/status.errors.ts Outdated
Comment thread apps/cli/src/commands/experimental/stack/status/status.handler.ts Outdated
Comment thread apps/cli/docs/stack-commands.md Outdated
Comment thread packages/config/src/experimental.ts
Comment thread apps/cli/src/commands/experimental/stack/status/status.env.ts
Comment thread apps/cli/src/commands/experimental/stack/status/status.handler.ts Outdated
Comment thread apps/cli/src/commands/experimental/stack/status/status.handler.ts
Comment thread apps/cli/src/commands/experimental/stack/status/SIDE_EFFECTS.md
Comment thread apps/cli/src/commands/experimental/stack/status/status.env.ts Outdated
Comment thread apps/cli/src/commands/experimental/stack/status/status.env.ts
Coly010 and others added 5 commits September 12, 2026 14:05
Classify lifecycle and dotenv-encoding failures as user-actionable
instead of network errors, surface the typed diagnostic when a config
comparison is rejected, reject repeated --override-name sources, use
double quotes for dotenv values that need them, return void from the
handler, and document exit codes, telemetry, and the legacy -o rejection.
Comment thread apps/cli/src/commands/experimental/stack/status/status.env.ts Outdated
Double quotes are used only for values without ", backslash, $, backtick,
or !, and backticks are no longer a delimiter, so sourcing the exported
file cannot run command substitutions embedded in a credential.
@jgoux
jgoux requested a review from Coly010 September 14, 2026 08:37
@Coly010
Coly010 added this pull request to the merge queue Sep 14, 2026
Merged via the queue into develop with commit e466998 Sep 14, 2026
29 checks passed
@Coly010
Coly010 deleted the feat/experimental-stack-status branch September 14, 2026 08:50
avallete added a commit that referenced this pull request Sep 14, 2026
Keep experimental stack status from #6508. Route db, migration, and test
through the same flag, and keep EphemeralPostgres plus Auth-off credentials.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants